home *** CD-ROM | disk | FTP | other *** search
/ Chip 2004 July / CMCD0704.ISO / Software / Freeware / Comunicatii / htttrack / httrack-3.32-2.exe / {app} / src / md5.h < prev    next >
Encoding:
C/C++ Source or Header  |  2004-05-08  |  1.1 KB  |  47 lines

  1. #ifndef MD5_H
  2. #define MD5_H
  3.  
  4. #ifdef _WIN32
  5. #ifndef SIZEOF_LONG
  6. #define SIZEOF_LONG 4
  7. #endif
  8. #else
  9. #include "config.h"
  10. #endif
  11.  
  12. #if SIZEOF_LONG==8
  13. typedef unsigned int uint32;
  14. #elif SIZEOF_LONG==4
  15. typedef unsigned long uint32;
  16. #else
  17. #error undefined: SIZEOF_LONG
  18. #endif
  19.  
  20. struct MD5Context {
  21.   uint32 buf[4];
  22.   uint32 bits[2];
  23.   unsigned char in[64];
  24.   int doByteReverse;
  25. };
  26.  
  27. void MD5Init(struct MD5Context *context, int brokenEndian);
  28. void MD5Update(struct MD5Context *context, unsigned char const *buf,
  29.                unsigned len);
  30. void MD5Final(unsigned char digest[16], struct MD5Context *context);
  31. void MD5Transform(uint32 buf[4], uint32 const in[16]);
  32.  
  33. int mdfile(char *fn, unsigned char *digest);
  34. int mdbinfile(char *fn, unsigned char *bindigest);
  35.  
  36. /* These assume a little endian machine and return incorrect results! 
  37. They are here for compatibility with old (broken) versions of RPM */
  38. int mdfileBroken(char *fn, unsigned char *digest);
  39. int mdbinfileBroken(char *fn, unsigned char *bindigest);
  40.  
  41. /*
  42. * This is needed to make RSAREF happy on some MS-DOS compilers.
  43. */
  44. typedef struct MD5Context MD5_CTX;
  45.  
  46. #endif /* !MD5_H */
  47.